import request from '../request'

import type { InsuranceRecordDto } from './type'

/**
 * 快速投保函数
 *
 * @param data 投保所需数据
 * @param data.qrProjectId 项目ID
 * @param data.staffRecord 员工记录
 * @param data.staffRecord.userName 员工姓名
 * @param data.staffRecord.idCardNo 员工身份证号
 * @returns 返回投保结果的Promise对象
 */
export function fastInsurance(data: {
    qrProjectId: string
    staffRecord: {
        userName: string
        idCardNo: string
    }
}) {
    return request.post('/api/v1/blue/period-insur/staff-record/ensure', data) as Promise<{
        code: number
        msg: string
        isSuccess: boolean
        record?: InsuranceRecordDto
    }>
}
